/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-16 15:37:51
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-16 16:11:20
 */
import 'package:flutter_data_center/model/common/floor_model.dart';
import 'package:flutter_data_center/net/dio_utils.dart';
import 'package:get/get.dart';

class CommonController extends GetxController {
  // 菜单列表
  List<FloorModel> _floors = [];
  List get floors => _floors;
  void getFloors() async {
    _floors = [];
    ResponseInfo responseInfo = await DioUtils.instance.getRequest(
      url: HttpHelper.floors,
    );
    if (responseInfo.success) {
      var data = responseInfo.data;
      for (var item in data) {
        _floors.add(FloorModel.fromJson((item)));
      }
      update();
    }
  }
}
